import { createStore } from 'vuex'
const getDefaultCity =()=>{
  let defaultCity ="武汉";
  if(localStorage.getItem("city")){
    defaultCity =localStorage.getItem("city")
  }
  return defaultCity
}
export default createStore({
  state: {
    city:getDefaultCity()
  },
  mutations: {
    changeCity(state,val){
      state.city =val
      localStorage.setItem("city",val)
    }
  },
  actions: {
  },
  modules: {
  }
})
